package cn.itzzx.lagou.minicat.servlet;

import cn.itzzx.lagou.minicat.request.Request;
import cn.itzzx.lagou.minicat.response.Response;
import cn.itzzx.lagou.minicat.utils.HttpProtocolUtil;

import java.io.IOException;

/**
 * TODO
 *
 * @author Martin
 * @since 1.0
 */
public class LagouServlet extends HttpServlet {

    @Override
    public void doGet(Request request, Response response) throws IOException, InterruptedException {
        String content = "<h1>Demo1 LagouServlet get </h1>";
        response.output(HttpProtocolUtil.getHttpHeader200(content.getBytes().length)+content);
    }

    @Override
    public void doPost(Request request, Response response) throws IOException {
        String content = "<h1>Demo1 LagouServlet post</h1>";
        response.output(HttpProtocolUtil.getHttpHeader200(content.getBytes().length)+content);
    }
}
